package com.cdty.chess.controller;

import com.cdty.chess.model.QrCode;
import com.cdty.chess.model.Withdraw;
import com.cdty.chess.service.WithdrawService;
import com.cdty.chess.vo.WithdrawVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.time.LocalDate;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/api/v1/withdraw")
public class WithdrawController {


    @Autowired
    WithdrawService service;

    /**
     * 新增提现申请
     */
    @PostMapping("/apply")
    public String apply(@RequestBody Withdraw qc){

        return service.apply(qc);
    }

    /**
     * 更新状态
     */
    @PostMapping("/update")
    public String update(@RequestParam String id){

        return service.update(id);
    }

    /**
     * 获取列表
     */
    @GetMapping("/getList")
    public Map<String,Object> getList(@RequestParam(required = false) String uid,
                                      @RequestParam(required = false) String uname,
                                      @RequestParam(required = false) String searchDate,
                                      Integer page,
                                      Integer size
                                      ){
        return service.getList(uid,uname,searchDate,page,size);
    }

}
